<include file="public@header"/>
<style>
    html{background-color: #fff}
</style>
</head>
<body>
<form method="post" class="layui-form js-ajax-form" action="{:url('link/editPost')}" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label for="input-link_name" class="layui-form-label"><span class="form-required">*</span>名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="input-link_name" required lay-verify="required" name="name" value="{$link.name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="input-link_url" class="layui-form-label"><span class="form-required">*</span>链接地址</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input" id="input-link_url" required lay-verify="required" name="url" value="{$link.url}">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="input-link_image" class="layui-form-label">图标</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="input-link_image" name="image" value="{$link.image}">
        </div>
        <div class="layui-input-inline layui-btn-container" style="width: auto;">
            <a href="javascript:uploadOneImage('图片上传','#input-link_image');" class="layui-btn layui-btn-primary"
               style="border: 1px dashed #e2e2e2;">
                <i class="layui-icon" style="color: #2d8cf0;"></i>上传图片
            </a>
        </div>
    </div>
    <div class="layui-form-item">
        <label for="input-target" class="layui-form-label">打开方式</label>
        <div class="layui-input-inline">
            <select class="layui-input" name="target" id="input-target">
                <foreach name="targets" item="vo">
                    <php>$link_target_selected=$link['target']==$key?"selected='selected'":"";</php>
                    <option value="{$key}" {$link_target_selected}>{$vo}</option>
                </foreach>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label for="input-link_description" class="layui-form-label">描述</label>
        <div class="layui-input-block">
                <textarea class="layui-textarea" name="description"
                          id="input-link_description">{$link.description}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="id" value="{$link.id}">
            <button type="submit" class="layui-btn js-ajax-submit js-close" id="js-ajax-submit">{:lang('SAVE')}</button>
        </div>
    </div>
</form>
<include file="public@script"/>
</body>
</html>